home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.cs.arizona.edu
/
ftp.cs.arizona.edu.tar
/
ftp.cs.arizona.edu
/
icon
/
newsgrp
/
group92c.txt
/
000090_icon-group-sender _Tue Nov 17 13:25:11 1992.msg
< prev
next >
Wrap
Internet Message Format
|
1993-01-04
|
1KB
Received: by cheltenham.cs.arizona.edu; Tue, 17 Nov 1992 14:42:10 MST
Date: Tue, 17 Nov 1992 13:25:11 MST
From: "Clint Jeffery" <cjeffery>
Message-Id: <199211172025.AA26141@chuckwalla.cs.arizona.edu>
To: Paul_Abrahams@MTS.cc.Wayne.edu
Cc: icon-group@cs.arizona.edu
In-Reply-To: Paul_Abrahams@MTS.cc.Wayne.edu's message of Tue, 17 Nov 92 10:50:06 EST <528466@MTS.cc.Wayne.edu>
Subject: Field names of a record type
Status: R
Errors-To: icon-group-errors@cs.arizona.edu
Paul Abrahams writes:
given the name of an Icon record type, is there a
straightforward way to list the names of its fields in the same order
as they appear in its definition? So far I haven't found one.
While you are waiting for that built-in function, the following program
demonstrates a technique that does what you ask. Normally I wouldn't
start from a *name* of a record type, but that's how you stated the problem.
Folks who don't believe in semi-colon insertion, let me know if you have
trouble reading this.
record r (alpha, beta, c)
procedure main()
every write(fieldnames("r"))
end
procedure fieldnames(r)
R := r()
every i := 1 to *R do {
s := name(R[i])
suspend s[find(".",s)+1:0]
}
end